package net.cyndeline.rlgraph.biconnectivity

import scalax.collection.immutable.Graph
import scalax.collection.GraphEdge.UnDiEdge

/**
 * Computes a list of biconnected components from a connected graph.
 */
trait BiconnectedComponentsOperation[VType, EType[X] <: UnDiEdge[X]] {

  /**
   * Computes a list of biconnected components from a connected graph.
   * @param graph A connected undirected graph.
   * @return A list of every biconnected component in the graph. If the graph is empty or only
   *         has one vertex, an empty list is returned.
   */
  def components(graph: Graph[VType, EType]): List[Graph[VType, EType]]
}
